# coding utf-8
import os. sys
home = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.home.append('/home/lanwenhong/tianya/trunk/client/python')
from memlinkclient import *
import test_init
import urllib
import urllib2
import json

class TableCreateTest:
    def __init__(self, memlink_addr, wport, rport, dserver, dport, htdocs_path):
        self.tinit = test_init(memlink_addr, wport, rport, dserver, dport, htdocs_path)
        self.urlbase = 'http://' + self.tinit.dserver + ':' + str(self.tinit.dport) + '/'
        print self.urlbase
        

    def create_table_test(self):
        store = 'hbase'
        for i in xrange(0, 20):
            filelds += 'item%d' % i

        rwokey = 'item1'
        desc = 'testing'
        address = self.tinit.memlink_addr

        params = 'store=%s&field=%s&rowkey=%s&desc=%s&address=%s' % (store, fields, rowkey, desc, address)
        print params
        url = self.urlbase + 'test_create_table' + '/' + 'create' + '?%s' % params
        print url
        f = urllib.urlopen(url)
        print f.read()
